from django.db import models


# 资讯类型选择（招生信息、政策动态等）
NEWS_TYPES = (
    ('Admission', '招生信息'),
    ('Policy', '政策动态'),
    ('Notice', '通知公告'),
)

# 考研资讯模型
class News(models.Model):
    title = models.CharField(max_length=200)
    content = models.TextField()
    news_type = models.CharField(max_length=20, choices=NEWS_TYPES)
    published_at = models.DateTimeField(auto_now_add=True)

    def __str__(self):
        return self.title